using System.Collections;
using UnityEngine;
using VoxelEngine;

namespace VoxelGame.World
{
	public class Skydome : MonoBehaviour
	{
		[SerializeField]
		private Transform _camera;

		[SerializeField]
		private MeshRenderer _meshRenderer;

		[SerializeField]
		private float _offsetY;

		private IEnumerator Start()
		{
			yield return null;
			_meshRenderer.material = BaseWorldController.VoxelPlayerData.VoxelWorldData.SkydomeMaterial;
		}

		private void LateUpdate()
		{
			Vector3 position = _camera.transform.position;
			position.y += _offsetY;
			base.transform.position = position;
		}
	}
}
